﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace GnToolMain
{
	public static class GnControlManager
	{
		static String mApplicationFolder;
		public static String ApplicationFolder
		{
			get
			{
				return GnControlManager.mApplicationFolder;
			}
			set
			{
				GnControlManager.mApplicationFolder = value;
			}
		}
		static String mLayoutFolder;
		public static System.String LayoutFolder
		{
			get
			{
				return mLayoutFolder;
			}
			set
			{
				mLayoutFolder = value;
			}
		}

		public static bool Init()
		{
			String appPath = Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData );
			mApplicationFolder = appPath + @"\GnEditor";

			if( Directory.Exists( mApplicationFolder ) == false )
				Directory.CreateDirectory( mApplicationFolder );

			mApplicationFolder += @"\";

			LayoutFolder = mApplicationFolder + "Layout";
			if( Directory.Exists( LayoutFolder ) == false )
				Directory.CreateDirectory( LayoutFolder );

			LayoutFolder += @"\";

			return true;
		}
	}
}
